<template>
  <main-window
    class="main-window"
    :initialLayout="layout"
    :initialWindows="windows"
    :storeLayout="true"
    @hidden-targets-changed="onHiddenTargetsChanged"
  >
    <template #layout-contents>
      <layout-content :teleport-target="'a'">
        <template #content>
          {{ "This is content! a" }}
        </template>
      </layout-content>
      <layout-content :teleport-target="'g'">
        <template #content>
          {{ "This is content! g" }}
        </template>
      </layout-content>
      <layout-content :teleport-target="'b21'">
        <template #content> content b21 </template>
      </layout-content>
    </template>
  </main-window>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import MainWindow from "@/components/MainWindow.vue";
import LayoutContent from "@/components/LayoutContent.vue";
import mock from "@/mock/mock.json";

export default defineComponent({
  name: "App",
  components: {
    MainWindow,
    LayoutContent,
  },
  data() {
    return {
      layout: mock.layout,
      windows: mock.windows,
    };
  },
  methods: {
    onHiddenTargetsChanged(hiddenTargets: string[]) {
      console.log("Hidden targets", hiddenTargets);
    },
  },
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100vh;
}

.main-window {
  height: 100%;
  width: 100%;
}
</style>
